docs(linter): Updated eslint/yoda rule with auto-gen config options, I have.#16562
docs(linter): Updated eslint/yoda rule with auto-gen config options, I have.#16562camchenry merged 2 commits intohandle-tuple-rules-betterfrom
eslint/yoda rule with auto-gen config options, I have.#16562Conversation
CodSpeed Performance ReportMerging #16562 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR modernizes the eslint/yoda rule to use DefaultRuleConfig for configuration handling and enables automatic schema generation. The rule configuration now uses a tuple struct pattern Yoda(AllowYoda, YodaOptions) to match ESLint's configuration format where the first parameter is a string mode ("never" or "always") and the second is an optional options object with exceptRange and onlyEquality properties.
Key Changes:
- Replaced manual configuration parsing with
DefaultRuleConfigwrapper for cleaner deserialization - Restructured configuration types to support automatic schema generation and documentation
- Removed the rule from the schema exclusion list in test configuration
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
crates/oxc_linter/src/rules/eslint/yoda.rs |
Refactored configuration handling: introduced AllowYoda enum and YodaOptions struct with proper serde/schema derives, updated from_configuration() to use DefaultRuleConfig, and adjusted run() method to destructure the tuple struct |
crates/oxc_linter/tests/rule_configuration_documentation_test.rs |
Removed eslint/yoda from the exclusion list since it now has proper schema support for auto-generated documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
camc314
left a comment
There was a problem hiding this comment.
lol, great PR title and description
ca59885 to
962bfe2
Compare
…rule, I have. Uses DefaultRuleConfig now, this rule does. Updated it to use a proper tuple config, I have. Continue to pass, the tests do.
|
Excellent theming on this PR 😄 |
Uses DefaultRuleConfig now, this rule does. Updated to use a proper tuple config, it has been.
Continue to pass, the tests do.
Part of #14743 and dependent on #16555, this PR is.
Generated docs: